home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5267 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  36 lines

  1. Newsgroups: comp.lang.c++
  2. Path: cs.vu.nl!jalten
  3. From: jalten@cs.vu.nl (Alten JP)
  4. Subject: Re: C++ display ASCII file
  5. Nntp-Posting-Host: kits.cs.vu.nl
  6. References: <4dtsed$309o@useneta1.news.prodigy.com> <zRgDxQTC387B089yn@pinerolo.gvo.it>
  7. Sender: news@cs.vu.nl
  8. Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
  9. Date: Sat, 3 Feb 1996 09:59:54 GMT
  10. X-Newsreader: TIN [version 1.2 PL2]
  11. Message-ID: <DM72Fv.49y.0.-s@cs.vu.nl>
  12.  
  13. Alberto Velo (albe@pinerolo.gvo.it) wrote:
  14. : In article <4e144f$82t@spectre.star.harc.edu>,
  15. : jaewan@diana.harc.edu (Jaewan Kim - ASTRO) wrote: 
  16.  
  17. : >:         ifstream src(argv[1], ios::nocreate);
  18.  
  19. : Why do you use ios::nocreate ? I mean, this is a file you read -not write- and 
  20. : I thought this is not needed. 
  21. : (I'm new to C++ :-)).
  22.  
  23. You're right. If you look at the source/header of fstream.h you'll
  24. see thatt the default arguments are something like
  25. ios::in, no ios::out, so it is readonly. 
  26. The line might just as have been like this:
  27.     ifstream src(argv[1]);
  28.  
  29. Jelle Paul
  30.  
  31. --
  32. +-------------------------------------------------------+
  33. | Jelle Paul Alten                |   jalten@cs.vu.nl   |
  34. | Vrije Universiteit Amsterdam    |                     |
  35. +-------------------------------------------------------+
  36.